package com.nauu.atombuilder.editors;

import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;

import com.nauu.atombuilder.util.Callback;

public class ClassWizard extends Wizard{

	private WizardNewFileCreationPage page;

	private TreeSelection selection;

	private Callback callback;
	
	public ClassWizard(Callback callback){
		this.callback = callback;
		this.setWindowTitle("新建");
		selection = new TreeSelection();
		page = new WizardNewFileCreationPage("创建应用模型对象",selection);
		page.setTitle("创建应用模型对象");
		this.addPage(page);
	}
	
	@Override
	public boolean performFinish() {
		String path = page.getContainerFullPath()+"/"+page.getFileName();
		callback.execute(path);
		return true;
	}

}
